Template = [
    {
        'name': 'system_audit_log',
        'template': {
            'index_patterns': ['system_audit_log'],
            'order': 1,
            'settings': {
                'number_of_replicas': 0,
                'number_of_shards': 1
            },
            'mappings': {
                'properties': {
                    'type': {'type': 'keyword'},  # Http/Task
                    'module': {'type': 'keyword'},
                    'sub_module': {'type': 'keyword'},
                    'summary': {'type': 'keyword'},
                    'name': {'type': 'keyword'},

                    'method': {'type': 'keyword'},
                    'ip': {'type': 'keyword'},
                    'account': {'type': 'keyword'},
                    'cost': {'type': 'double'}
                }
            }
        }
    },
    {
        'name': 'system_event_log',
        'template': {
            'index_patterns': ['system_event_log'],
            'order': 1,
            'settings': {
                'number_of_replicas': 0,
                'number_of_shards': 1
            },
            'mappings': {
                'properties': {
                    'type': {'type': 'keyword'},  # Http/Task
                    'module': {'type': 'keyword'},
                    'sub_module': {'type': 'keyword'},
                    'summary': {'type': 'keyword'},
                    'name': {'type': 'keyword'},

                    'method': {'type': 'keyword'},
                    'ip': {'type': 'keyword'},
                    'account': {'type': 'keyword'},
                    'detail': {'type': 'double'}
                }
            }
        }
    }
]


Component = {
    "dsm_dft": {
        "template": {
            "settings": {
                "index.number_of_shards": 5,
                "index.number_of_replicas": 0,
                "index.refresh_interval": "60s",
                "index.codec": "default",
                "index.routing.allocation.require.temp": "*hot*",

                "analysis": {
                        "analyzer": {
                            "default": {
                                "tokenizer": "standard",
                                "char_filter": [
                                    "special_mapping"
                                ]
                            }
                        },
                        "char_filter": {
                            "special_mapping": {
                                "type": "mapping",
                                "mappings": [
                                    "! =>. MarkExclamation .",
                                    "? =>. MarkQuestion .",
                                    ", =>. MarkComma .",
                                    ". =>. MarkDot .",
                                    ": =>. MarkColon .",
                                    "; =>. MarkSemicolon .",
                                    "\" =>. MarkDoubleQuote .",
                                    "' =>. MarkSingleQuote .",
                                    "` =>. MarkBackQuote .",
                                    "* =>. MarkAsterisk .",
                                    "+ =>. MarkPlus .",
                                    "- =>. MarkDash .",
                                    "= =>. MarkEqual .",
                                    "/ =>. MarkSlash .",
                                    "\\\ =>. MarkBackslash .",
                                    "| =>. MarkVertical .",
                                    "$ =>. MarkDollar .",
                                    "@ =>. MarkAt .",
                                    "# =>. MarkCrosshatch .",
                                    "% =>. MarkPercent .",
                                    "& =>. MarkAnd .",
                                    "^ =>. MarkCircumflex .",
                                    "~ =>. MarkTilde .",
                                    "{ =>. MarkLeftBraces .",
                                    "} =>. MarkRightBraces .",
                                    "[ =>. MarkLeftBrackets .",
                                    "] =>. MarkRightBrackets .",
                                    "( =>. MarkLeftParentheses .",
                                    ") =>. MarkRightParentheses .",
                                    "< =>. MarkLessThan .",
                                    "> =>. MarkGreaterThan."
                                    ]
                                }
                            }
                    }

            },
            "mappings": {
                "dynamic": "false",
                "dynamic_templates": [
                    {
                        "strings_as_keywords": {
                            "match_mapping_type": "string",
                            "mapping": {
                                "type": "keyword",
                                "ignore_above": 256
                            }
                        }
                    }
                ]
            }
        }
    }
}
